package com.example.demo.service.impl;

import com.example.demo.dao.UserDao;
import com.example.demo.pojo.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    //通过手机号查询
    @Override
    public List<User> selectByphonenumber(String phonenumber) {
        return userDao.selectByphonenumber(phonenumber);
    }

    //新增用户
    @Override
    public int insert(User user) {
        return userDao.insertSelective(user);
    }

    //修改用户信息
    @Override
    public int updateByUserId(User user) {
        return userDao.updateByPrimaryKeySelective(user);
    }


}
